package com.gxuwz.endrskyweather.util;

public class CodeCastText {

    /**
     * 风向代码转文字
     * @param code 风向代码
     * @return 风向文字
     */
    public static String WindCast(String code) {
        switch (code) {
            case "0":
                return "无持续风";
            case "1":
                return "东北风";
            case "2":
                return "东风";
            case "3":
                return "东南风";
            case "4":
                return "南风";
            case "5":
                return "西南风";
            case "6":
                return "西风";
            case "7":
                return "西北风";
            case "8":
                return "北风";
            default:
                return "获取失败";
        }
    }

    /**
     * 风力代码转文字
     * @param code 风力代码
     * @return 风力文字
     */
    public static String WindPowerCast(String code) {
        switch (code) {
            case "0":
                return "<3级";
            case "1":
                return "3-4级";
            case "2":
                return "4-5级";
            case "3":
                return "5-6级";
            case "4":
                return "6-7级";
            case "5":
                return "7-8级";
            case "6":
                return "8-9级";
            case "7":
                return "9-10级";
            case "8":
                return "10-11级";
            case "9":
                return "11-12级";
            default:
                return "获取失败";
        }
    }

}
